function indices = pairIndices(n)
  [y, x] = find(tril(logical(ones(n)), -1)); %#ok<LOGL>
  indices = [x, y];
end